#ifndef GCC_ATOMICORBITAL_ATOMIC_ORBITAL_H
#define GCC_ATOMICORBITAL_ATOMIC_ORBITAL_H
constexpr int M=100;
constexpr raw_t_ubit8 color_data[303]={0, 0, 0, 5, 2, 7, 11, 4, 15, 17, 6, 23, 22, 8, 31, 28, 10, 38, 34, \
12, 46, 40, 14, 54, 45, 16, 62, 51, 18, 70, 57, 20, 77, 62, 22, 85, \
68, 25, 93, 74, 27, 101, 80, 29, 108, 85, 31, 116, 91, 33, 124, 97, \
35, 128, 103, 37, 124, 110, 39, 121, 116, 41, 117, 123, 43, 113, 129, \
44, 110, 135, 46, 106, 142, 48, 103, 148, 50, 99, 154, 52, 95, 161, \
54, 92, 167, 56, 88, 174, 58, 85, 180, 60, 81, 186, 62, 77, 193, 63, \
74, 199, 65, 70, 203, 68, 67, 206, 71, 63, 209, 74, 60, 212, 77, 56, \
215, 80, 53, 218, 83, 50, 221, 86, 46, 224, 89, 43, 227, 92, 40, 230, \
94, 36, 233, 97, 33, 236, 100, 29, 238, 103, 26, 241, 106, 23, 244, \
109, 19, 247, 112, 16, 250, 115, 13, 251, 119, 14, 251, 122, 15, 251, \
126, 16, 251, 129, 17, 252, 133, 19, 252, 136, 20, 252, 140, 21, 253, \
143, 22, 253, 147, 23, 253, 151, 25, 254, 154, 26, 254, 158, 27, 254, \
161, 28, 255, 165, 29, 255, 168, 31, 255, 172, 32, 255, 175, 35, 255, \
178, 40, 255, 181, 46, 255, 184, 51, 255, 188, 57, 255, 191, 62, 255, \
194, 68, 255, 197, 73, 255, 200, 79, 255, 203, 85, 255, 206, 90, 255, \
209, 96, 255, 212, 101, 255, 215, 107, 255, 218, 112, 255, 221, 118, \
255, 224, 123, 255, 227, 130, 255, 228, 138, 255, 230, 146, 255, 232, \
154, 255, 234, 162, 255, 236, 170, 255, 237, 177, 255, 239, 185, 255, \
241, 193, 255, 243, 201, 255, 245, 209, 255, 246, 216, 255, 248, 224, \
255, 250, 232, 255, 252, 240, 255, 254, 248, 255, 255, 255};
template<typename T,typename T1=int>
struct ImageInfo
{
    ImageInfo(T x_0,T x_1,T y_0,T y_1,T1 w,T1 h,T1 c):
            x0(x_0),y1(y_1),width(w),height(h),channels(c){
        x_delta=(x_1-x_0)/(w-1);
        y_delta=(y_0-y_1)/(h-1);
    }
    T x0,y1,x_delta,y_delta;
    T1 width,height,channels;
};
template<typename  T,typename T1>
inline T atomic_orbital_probability(T1 n,T1 l,T1 m,const T &x,const T &y)
{
    T s=sqrt(x*x+y*y);
    return exp(-2*s/n)*pow(s/n,2.0*l)*pow(std::assoc_legendre(l,m,y/s)*std::assoc_laguerre(n-l-1,1+2*l,2*s/n),2.0);
}
template<typename T,typename T1>
inline void color_func(T *data_out,const T1 x)
{
    std::copy_n(color_data+3*lround(M*pow(x,0.5)),3,data_out);
}
#endif //GCC_ATOMICORBITAL_ATOMIC_ORBITAL_H
